/*
 * @Description: 游戏配置管理 - 热源配置tab
 * @Date: 2023-06-02 09:44:43
 * @Author: jiao-xiao-lin
 */
import React, { useState, useEffect } from 'react';
import { Tooltip } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import EditTable from '@/component/EditTable/heatSourceConfig.jsx';
import { dataSource, columns } from './config';
import { getHeatSourceCfg } from '@/api/game_managememnt';

const HeatSourceConfig = () => {
  const [list, setList] = useState([]);
  useEffect(() => {
    const fetchData = async () => {
      try {
        const resp = await getHeatSourceCfg({
          projectId: '614',
          page: 1,
          rows: 10,
        });

        setList(resp.data.data.heatSourceCfgList);
      } catch (err) {}
    };
    fetchData();
  }, []);
  return (
    <div>
      <Tooltip
        placement="right"
        title="没有配置热源的产品，默认会取Shell_Frame作为壳温"
      >
        <QuestionCircleOutlined />
      </Tooltip>

      <EditTable
        columns={columns}
        dataSource={list}
        rowKey="lowShellTemperatureThreshold"
        setList={setList}
      />
    </div>
  );
};

export default HeatSourceConfig;
